home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-27 | 5.7 KB | 273 lines | [TEXT/MPS ] |
- // imWare
- // Wednesday, February 14, 1990
- // James Beninghaus
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
- #ifndef __DEVICES__
- #include <Devices.h>
- #endif
-
- #define csVerifyTheDisc 5
- #define csWhoIsThere 97
- #define csReadTOC 100
- #define csReadQ 101
- #define csATrkSearch 103
- #define csAPlay 104
- #define csAPause 105
- #define csAStop 106
- #define csAStatus 107
- #define csAScan 108
- #define csASetVolume 109
- #define csAGetVolume 112
-
- #define BLOCKADDR 0
- #define MSFADDR 1
- #define TRACKADDR 2
-
- #define TOCTRACKS 1
- #define TOCENDOFDISK 2
- #define TOCSTARTADDR 3
-
- #define STEREO 9
- #define MONO 15
-
- #define START 0
- #define STOP 1
-
- #define PAUSE 1
- #define CONTINUE 0
-
- #define PLAYING 0
- #define PAUSED 1
-
- //typedef unsigned char Byte;
- typedef unsigned short Word;
- typedef unsigned long Long;
-
- typedef struct WhoIsThereRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Byte fill;
- Byte SCSIMask;
- } csParam;
- } WhoIsThereRec;
-
- typedef struct AStatusRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Byte audioStatus;
- Byte playMode;
- Byte cntlField;
- Byte minutes;
- Byte seconds;
- Byte frames;
- } csParam;
- } AStatusRec;
-
- typedef struct AVolumeRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Byte leftChannel;
- Byte rightChannel;
- short unused[9];
- } csParam;
- } AVolumeRec;
-
- typedef struct {
- Byte cntlField;
- Byte minutes;
- Byte seconds;
- Byte frames;
- } StartAddrRec;
-
- typedef struct {
- Byte minutes;
- Byte seconds;
- Byte frames;
- Byte filler;
- } OffsetStartAddrRec;
-
-
- typedef struct ReadTOCRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- union {
- Word type;
- Byte addr[3];
- struct {
- Word fill;
- Long data;
- Word length;
- Byte track;
- } buffer;
- } csParam;
- } ReadTOCRec;
-
- typedef struct ReadQRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Byte cntlField;
- Byte currentTrack;
- StartAddrRec addrFromTrackStart;
- OffsetStartAddrRec addrFromDiscStart;
- Byte fill;
- } csParam;
- } ReadQRec;
-
- typedef struct APlayRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Word type;
- Byte addr[4];
- Word startStop;
- Byte fill;
- Byte playMode;
- } csParam;
- } APlayRec;
-
- typedef struct ATrkSearchRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Word type;
- Byte addr[4];
- Word playFlag;
- Byte fill;
- Byte playMode;
- } csParam;
- } ATrkSearchRec;
-
- typedef struct AStopRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Word type;
- Byte addr[4];
- } csParam;
- } AStopRec;
-
- typedef struct APauseRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Long state;
- } csParam;
- } APauseRec;
-
- typedef struct AScanRec {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short csCode;
- struct {
- Word type;
- Byte addr[4];
- Word directionFlag;
- Byte fill;
- } csParam;
- } AScanRec;
-
- void Usage (void);
- pascal Byte Decimal2BCD (Byte n);
- pascal Byte BCD2Decimal (Byte n);
- pascal OSErr EjectCD (short ioRefNum);
- pascal OSErr OpenCD (Byte CDDrive, short *ioRefNum);
- pascal OSErr APlay (short ioRefNum, Byte startTrack, Byte playMode);
- pascal OSErr APause (short ioRefNum, Long state);
- pascal OSErr AStop (short ioRefNum, Byte stopTrack);
- pascal OSErr ATrkSearch (short ioRefNum, Byte track, Byte playFlag, Byte playMode);
- pascal OSErr AStatus (short ioRefNum, Byte *audioStatus, Byte *playMode, Byte *cntlField, Byte *minutes, Byte *seconds, Byte *frames);
- pascal OSErr TrackCount (short ioRefNum, Byte *lastTrack);
- pascal OSErr TrackInfo (short ioRefNum, Byte track, Byte *cntlField, Byte *minutes, Byte *seconds, Byte *frames);
- pascal OSErr AScan(short ioRefNum, Byte startMin, Byte startSec, Byte startFrame, Byte direction);
- pascal OSErr ACurrInfo(short ioRefNum, Byte *currentTrack, Byte *discMinutes, Byte *discSeconds, Byte *discFrames);
- pascal OSErr ACurrTrackInfo(short ioRefNum, Byte *currentTrack, Byte *discMinutes, Byte *discSeconds, Byte *discFrames);
- pascal OSErr AGetVolume(short ioRefNum, short *volume);
- pascal OSErr ASetVolume(short ioRefNum, short volume);
- pascal Boolean DiscInDrive(short ioRefNum);
-